<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
      xmlns:layout="http://www.thymeleaf.org" layout:decorator="layouts/editableLayout">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

    <div layout:fragment="bodyContent">
        <form id="createCateForm" method="post" enctype="multipart/form-data" action="/cate/create">
            <div class="form-group">
                <label for="new_cate_name">Name:</label>
                <input type="text" name="name" class="form-control" id="new_cate_name"/>
            </div>
            <div class="form-group">
                <label for="new_cate_shortcut">Shortcut:</label>
                <input type="text" name="shortcut" class="form-control" id="new_cate_shortcut"/>
            </div>
            <div class="form-group">
                <label for="new_cate_price">Price:</label>
                <input type="number" name="price" class="form-control" id="new_cate_price"/>
            </div>
            <div class="form-group">
                <label for="new_cate_vip_price">Vip price:</label>
                <input type="number" name="vipPrice" class="form-control" id="new_cate_vip_price"/>
            </div>
            <div class="form-group" id="categoryGroup">

            </div>
            <div class="form-group">
                <div  id="new_cate_description"></div>

            </div>

            <div class="form-group">
                <input type="button" onclick="saveOrUpdateCate(1)" class="btn btn-success btn-block" value="Create"/>
            </div>

        </form>
        <script src="/js/hzy-1.0/hzy-category.js"></script>
        <script src="/js/hzy-1.0/hzy-cate.js"></script>
        <script src="https://cdn.quilljs.com/1.3.6/quill.js"></script>
        <script>
            var quill = new Quill('#new_cate_description', {
              modules: { toolbar: toolbarOptions },
              theme: 'snow'
            });

            $(document).ready(function(){
                var cateId = $("#cate_id").val();
                $("#categoryGroup").loadCategory({'cate_id':cateId});
            });
        </script>
    </div>

</body>
</html>